/**
 * Created with IntelliJ IDEA.
 * User: 维他柠檬猹
 * Date: 2018/3/1 9:16
 * Project: Angular_Seed_Project
 * Package:
 */
var tableDir = angular.module('tableDir', []);
tableDir.directive('tableDir', function () {
    return {
        template: '<button type="button" class="btn btn-xs btn-outline {{x.result === \'成功\' ? \'btn-primary\' : \'btn-danger\'}}" data-toggle="modal" data-target="#exampleModal" data-whatever="{{x.orderId}}" ng-click="testCl()">{{x.result}}</button>',
        link:function ($scope) {
            $scope.testCl = function () {
                console.log('aaaaasd')
            }
            $('#exampleModal').on('show.bs.modal', function (event) {
                var button = $(event.relatedTarget)
                var recipient = button.data('whatever')
                var modal = $(this)
                modal.find('.modal-title').text('订单详情：' + recipient + '')
                modal.find('.modal-body input').val(recipient)
            })
        }
    };
})